//Random Game Engine
//Copyright (C) 2013  Nikolay Dionisov

//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.



#ifndef __FRAMEWORK_MAIN__H_INCLUDED__
#define __FRAMEWORK_MAIN__H_INCLUDED__

#include <vector>
#include "..\SystemInterface.h"
#include "..\Managers\Platform Manager\WindowsPlatform.h"
#include "Sheduler.h"
#include "ThreadPool.h"
namespace re
{
	namespace core
	{
		class ManagerContainer;
		//Taking care of Universal Scene and sheduler
		class Framework : public IFramework
		{
		public:
			Framework() {}
			virtual ~Framework() {}

			void InitializeManagers(ManagerContainer* managers);
			void MainLoop();
			void ShutDown();
			void RunLogic(ILogic* logic);

			void LoadScene() {}
			void SetupScene(bool minimal_rebuild) {}

			//Load a system/module and autocall AddSystem to it
			bool LoadSystem(std::wstring& source, int priority);
			//registers a system in the framework.(It is beeing added everywhere it shoud)
			void AddSystem(ISystem* system, int priority);


			ManagerContainer* GetManagerContainer();
		private:
			ManagerContainer* pmanagers_;
			IPlatformManager* platform_manager;

			Sheduler sheduler_;
			ThreadPool thread_pool_;
		};
	}
}

#endif